//
//  MyShowTableViewCell.m
//  QXShowing
//
//  Created by 王道道 on 2018/5/1.
//  Copyright © 2018年 doll_dream. All rights reserved.
//

#import "MyShowTableViewCell.h"

@implementation MyShowTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initView];
    }
    return self;
}

- (void)initView {
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textColor = Text_Color_000000;
    self.titleLabel.text = @"杭州白马湖国际会展中心（3.4-3.5）";
    self.titleLabel.font = BHFont_Size_15;
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(10);
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.centerX.equalTo(self.contentView);
    }];
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.textColor = Text_Color_888888;
    self.nameLabel.text = @"布料展";
    self.nameLabel.font = BHFont_Size_13;
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLabel.mas_bottom).offset(15);
        make.left.equalTo(self.titleLabel.mas_left);
    }];
    
    self.numberLabel = [[UILabel alloc]init];
    self.numberLabel.textColor = Text_Color_888888;
    self.numberLabel.text = @"A区304";
    self.numberLabel.font = BHFont_Size_13;
    [self.contentView addSubview:self.numberLabel];
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameLabel);
//        make.left.equalTo(self.contentView.mas_centerX);
        make.left.equalTo(self.nameLabel.mas_right).offset(20);
//        make.right.equalTo(self.contentView.mas_right).offset(-10);
    }];
}

- (void)setModel:(MyShowListModel *)model {
    if (![BHSettingUtil dataAndStringIsNull:model]) {
        _model = model;
        NSString *timeStr = [NSString stringWithFormat:@"%@~%@", [BHSettingUtil dataAndStringIsNull:model.start_date]?@"":model.start_date, [BHSettingUtil dataAndStringIsNull:model.end_date]?@"":model.end_date];
        self.titleLabel.text = [BHSettingUtil dataAndStringIsNull:model.exhibition_name]?@"":[NSString stringWithFormat:@"%@(%@)", model.exhibition_name, timeStr];
        self.nameLabel.text = [BHSettingUtil dataAndStringIsNull:model.area_tag_name]?@"":model.area_tag_name;
        self.numberLabel.text = [BHSettingUtil dataAndStringIsNull:model.area_name]?@"":([BHSettingUtil dataAndStringIsNull:model.booth_id]?@"":[NSString stringWithFormat:@"%@%@", model.area_name, model.booth_id]);
    }
}

@end
